package com.xuecheng.base.exception;

import lombok.Data;

/**
 * @author 顾梦
 * @description 本项目自定义异常类型
 * @since 2023/7/12
 */
@Data
public class XueChengPlusException extends RuntimeException {
    private String errMessage;

    public XueChengPlusException() {
    }


    public XueChengPlusException(String message) {
        super(message);
        this.errMessage = message;
    }

    public static void cast(String errMessage){
        throw new XueChengPlusException(errMessage);
    }

    public static void cast(CommonError error){
        throw new XueChengPlusException(error.getErrMessage());
    }
}
